
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class HomeWork07 {
    public static void main(String[] args) {
        Round round = new Round();
        Rectangle rectangle = new Rectangle();
        Triangle triangle = new Triangle();
        Scanner scanner = new Scanner(System.in);
        double[] arr = new double[6];
        int k = 0;
        String[] str = new String[10];
        for (int i = 0; i < 3; ++i) {
            str[i] = scanner.nextLine();
        }
        String regex = "\\d+.\\d+";
        Pattern p = Pattern.compile(regex);
        for (int i = 0; i < 3; ++i) {
            Matcher m = (Matcher) p.matcher(str[i]);
            while (((java.util.regex.Matcher) m).find()) {
                if (!"".equals(((java.util.regex.Matcher) m).group()))
                    arr[k++] = Double.parseDouble(((java.util.regex.Matcher) m).group());
            }
        }
        double radius = arr[0];
        double a = arr[1];
        double b = arr[2];
        double c = arr[3];
        double a1 = arr[4];
        double a2 = arr[5];

        System.out.println("The area are as follow:");
        System.out.printf("%.2f\n", round.area(radius));
        System.out.printf("%.2f\n", triangle.area(a, b, c));
        System.out.printf("%.2f\n", rectangle.area(a1, a2));
        System.out.println("The diameter are as follow:");
        System.out.printf("%.2f\n", round.diameter(radius));
        System.out.printf("%.2f\n", triangle.diameter(a, b, c));
        System.out.printf("%.2f\n", rectangle.diameter(a1, a2));
    }
}

abstract class Shape {
    abstract void area();

    abstract void diameter();
}

class Round extends Shape {
    @Override
    void area() {

    }

    void diameter() {

    }

    public double area(double radius) {
        return 3.14 * radius * radius;
    }

    public double diameter(double radius) {
        return 3.14 * 2 * radius;
    }
}

class Rectangle extends Shape {
    @Override
    void area() {

    }

    void diameter() {

    }

    public double area(double a1, double a2) {
        return a1 * a2;
    }

    public double diameter(double a1, double a2) {
        return a1 * 2 + a2 * 2;
    }
}

class Triangle extends Shape {
    @Override
    void area() {

    }

    void diameter() {

    }

    public double area(double a, double b, double c) {
        double s = (a + b + c) / 2;
        double ans = Math.sqrt(s * (s - a) * (s - b) * (s - c));
        return ans;
    }

    public double diameter(double a, double b, double c) {
        return a + b + c;
    }
}